<template>
	<div>
		<div class="crumbs">
			<el-breadcrumb separator="/">
				<el-breadcrumb-item><i class="el-icon-lx-cascades"></i>{{title}}</el-breadcrumb-item>
			</el-breadcrumb>
		</div>
		<examQuestions ref="examQuestions" :isTheme="true" :isChild="true" :editForm="form"></examQuestions>
	</div>
</template>

<script>
	import examQuestions from "@/components/examQuestions"
	export default {
		name: 'createSmallQuestionLibrary',
		data() {
			return {
				title: '',
				Authorization: {
					Authorization: localStorage.getItem('htk_token')
				},
				form: {}
			}
		},
		components: {
			examQuestions
		},
		mounted() {
			if (this.$route.query.id) {
				this.title = '编辑子试题'
				this.getDetail()
			} else {
				this.title = '新建子试题'
			}
		},
		methods: {
			async getDetail() {
				const res = await this.$http.get(this.$host + '/admin/question/getQuestionById?id=' + this.$route.query
					.id, {
						headers: this.Authorization
					})
				this.form = res.data.data
				setTimeout(() => {
					this.$refs.examQuestions.show()
				})
			},
		}
	}
</script>

<style>
</style>
